c6a01c12150d08332bf067184186fa4eaa853566,frontend-maven-plugin/src/main/java/com/github/eirslett/maven/plugins/frontend/mojo/GruntMojo.java,GruntMojo,shouldExecute,#,83
Before Change
}
private boolean shouldExecute() {
if (skip) {
return false;
}
// If there is no buildContext, or this is not an incremental build, always execute.
if (buildContext == null || !buildContext.isIncremental()) {
return true;
}
if (triggerfiles != null) {
for (int i = 0; i < triggerfiles.length; i++) {
if (buildContext.hasDelta(triggerfiles[i])) {
return true;
}
}
} else {
// Check for changes in the Gruntfile.js
if (buildContext.hasDelta(new File(workingDirectory, "Gruntfile.js"))) {
return true;
}
}
if (srcdir == null) {
getLog().info("grunt goal doesn't have srcdir set: not checking for modified files");
return true;
}
// Check for changes in the srcdir
Scanner scanner = buildContext.newScanner(srcdir);
scanner.scan();
String[] includedFiles = scanner.getIncludedFiles();
return (includedFiles != null && includedFiles.length > 0);
}
}
After Change
}
private boolean shouldExecute() {
if (triggerfiles == null || triggerfiles.isEmpty()) {
triggerfiles = Arrays.asList(new File(workingDirectory, "Gruntfile.js"));
}
return MojoUtils.shouldExecute(buildContext, triggerfiles, srcdir);
}
}